<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>复习</title>

</head>
<body>

<div id="box1">
    <span>哈哈哈</span>
    <h1>嘻嘻嘻</h1>
    <h2>呵呵呵
        <span>嗤嗤嗤</span>
    </h2>
</div>

<script>

    var box1 = document.getElementById('box1');
    // var result = box1.getElementsByTagName('div');
    // alert(result.length);

    // alert(box1.innerText);

    box1.innerText = '<h1>今天天气真不错</h1>';

</script>
</body>



</html>

